# 书籍为B类
class Book:
    def __init__(self, title, author):
        self.title = title
        self.author = author

    def __repr__(self):
        return f'书名：{self.title}, 作者：{self.author}'

# 图书馆为A类
class Library:
    def __init__(self):
        self.books = []

    def add_book(self, book):
        self.books.append(book)

    def list_books(self):
        for book in self.books:
            print(book)

# 创建书籍对象
book1 = Book("《西游记》", "吴承恩")
book2 = Book("《红楼梦》", "曹雪芹")
book3 = Book("《三国演义》", "罗贯中")
book4 = Book("《水浒传》", "施耐庵")

# 创建图书馆对象
library = Library()

# 将书籍添加到图书馆
library.add_book(book1)
library.add_book(book2)
library.add_book(book3)
library.add_book(book4)

# 列出图书馆中的所有书籍
library.list_books()